<template>
    <div>
      <Form :loadapi="loadapi" :loadParams="loadParams" :submitapi="submitapi" :callBack="handleSubmited" :idobject="idobject" mode="page"></Form>
    </div>
  </template>
  
  <script setup lang="ts" name="contactForm">
  import Form from "@/components/common/From.vue";
  
  import { ref, onMounted, reactive } from "vue";
  import { useRouter, useRoute } from "vue-router";
  const router = useRouter();
  const route = useRoute();
  
  import { useRouterStore } from "@/stores/router";
  const routerStore = useRouterStore();
  
  interface loadParamsIF {
    [x: string]: any; //动态添加属性
  }
  
  const loadapi = ref("");
  
  
  const submitapi = ref("");
  const {idobject,relopeid,headid,bodyid,refobject} = route.query;
  const loadParams: loadParamsIF = {
    idobject,
    relopeid,
    headid,
    bodyid,
    refobject
  };

  loadapi.value = `${refobject}.sdnew.do`;
  submitapi.value = `${idobject}.newsave.do`;
  
  function handleSubmited() {
    routerStore.mode = "reload";
    router.go(-1);
  }
  
  onMounted(() => {});
  </script>
  
  <style scoped>
  </style>